package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.domain.TravelComment;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();
    int updateByPrimaryKey(Travel record);

    /**
     * 高级查询
     * @param qo
     * @return
     */
    List<Travel> selectForList(QueryObject qo);

    /**
     * 更新状态
     * @param travel
     */
    void updateState(Travel travel);

    List<Travel> selecttravelsByStrategyId(@Param("strategyId") Long strategyId);

    void deleteRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    List<Travel> selectRegionTravelByStrategyId(Long trategyId);

    void saveRelation(@Param("strategyId") Long strategyId, @Param("travelId") Long travelId);

    int selectGreatNum(Long travelId);

    void updateGreatNum(@Param("travelId") Long travelId, @Param("greatNum") int i);
    List<Travel> selectTravelByFriend(QueryObject qo);

    int selectCommentNum(Long travelId);


    int getFansS( Long id);

    List<Travel> selectTavelsByuserId(Long id);

    void updateCommentNum(@Param("travelId") Long travelId, @Param("commentNum") int i);
}